package day14.problem2;

//组队竞赛
//https://www.nowcoder.com/questionTerminal/6736cc3ffd1444a4a0057dee89be789b

import java.util.*;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        long[] arr = new long[n * 3];
        for(int i = 0; i<n*3; i++) {
            arr[i] = in.nextInt();
        }
        Arrays.sort(arr);
        long ret = 0;
        for(int i = n*3-2,j = 0; j < n; i-=2, j++) {
            ret += arr[i];
            // System.out.println(arr[i]);
        }
        System.out.println(ret);
    }
}

/*
i                  j   
0 1 2 3 4 5 6 700 800

1 2 5 5 5 8

*/